﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong
{
    public partial class AjaxDelete : System.Web.UI.Page
    {
        private ProductDetailBUS proBus = new ProductDetailBUS();
        protected void Page_Load(object sender, EventArgs e)
        {
            String type = Request.Params["type"] ?? "";
            String data = Request.Params["data"] ?? "";
            //sString response = "";
            if (type.Equals("Product") && data.Contains("'")) {
                String[] arrID = data.Split('|');
                int i = 0;
                foreach (var item in arrID) {
                    if(proBus.deleteProduct(item)) i++;
                }
                Response.Write(i.ToString());
            }
        }
    }
}